﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="temp.aspx.cs" Inherits="_temp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .style1
        {
            width: 104px;
        }
    select
    {
        font: 16px tahoma, arial;
        padding: 5px;
    }

* {margin: 0; padding: 0; list-style: none;}
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
                <table style="width:100%">
                <tr>
                    <td>
                        <table style="width:400px;">
                            <tr>
                                <td class="style1">
                                    <strong>Segmento:</strong></td>
                                <td>
                                    <asp:DropDownList ID="ddSegmento" runat="server" AutoPostBack="True">
                                        <asp:ListItem></asp:ListItem>
                                        <asp:ListItem Value="adm">ADMINISTRATIVO</asp:ListItem>
                                        <asp:ListItem Value="loj">LOJISTA</asp:ListItem>
                                        <asp:ListItem Value="ope">OPERAÇÕES/INFRAESTRUTURA</asp:ListItem>
                                        <asp:ListItem Value="aeb">ALIMENTOS E BEBIDAS</asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td class="style1">
                                    <strong>Experiência:</strong></td>
                                <td>
                                    <asp:DropDownList ID="ddFuncoes" runat="server" DataSourceID="dsFuncoes" 
                                        DataTextField="Funcao" DataValueField="CodFuncao" 
                                        AppendDataBoundItems="True">
                                        <asp:ListItem></asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:SqlDataSource ID="dsFuncoes" runat="server" 
                                        ConnectionString="<%$ ConnectionStrings:conexao_intranet_ler %>" 
                                        ProviderName="<%$ ConnectionStrings:conexao_intranet_ler.ProviderName %>" SelectCommand="SELECT     CodFuncao, Funcao
FROM         CamaraFuncoes
WHERE Segmento = @segmento
ORDER BY Funcao">
                                        <SelectParameters>
                                            <asp:ControlParameter ControlID="ddSegmento" Name="segmento" 
                                                PropertyName="SelectedValue" />
                                        </SelectParameters>
                                    </asp:SqlDataSource>
                                </td>
                            </tr>
                            <tr>
                                <td class="style1">
                                    <strong>Local:</strong></td>
                                <td>
                                    <asp:TextBox ID="txtLocal" runat="server" MaxLength="100" Width="300px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="style1">
                                    <strong>Tempo:</strong></td>
                                <td>
                                    <asp:TextBox ID="txtTempo" runat="server" MaxLength="20"></asp:TextBox>
                                &nbsp;<span>(ex: 2 anos e 5 meses)</span></td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:ImageButton ID="btnCadastrarExperiencia" runat="server" 
                            ImageUrl="../figuras/bCadastrar.gif" 
                            onclick="btnCadastrarExperiencia_Click" ValidationGroup="gExperiencia" 
                            PostBackUrl="#qualificacoes" />
                        <asp:RequiredFieldValidator ID="RV5" runat="server" ControlToValidate="ddFuncoes" 
                            Display="None" ErrorMessage="Informe a experiência" 
                            ValidationGroup="gExperiencia"></asp:RequiredFieldValidator>
                        <asp:RequiredFieldValidator ID="RV6" runat="server" ControlToValidate="txtLocal" 
                            Display="None" ErrorMessage="Informe o local" 
                            ValidationGroup="gExperiencia"></asp:RequiredFieldValidator>
                        <asp:RequiredFieldValidator ID="RV7" runat="server" ControlToValidate="txtTempo" 
                            Display="None" ErrorMessage="Informe o tempo" 
                            ValidationGroup="gExperiencia"></asp:RequiredFieldValidator>
                        <asp:ValidationSummary ID="VS3" runat="server" ShowMessageBox="True" 
                            ShowSummary="False" ValidationGroup="gExperiencia" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblMensagemExperiencia" runat="server" EnableViewState="False" 
                            ForeColor="Blue"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td>
                    &nbsp;
                    </td>
                </tr>

                <tr>
                    <td>
                        <img alt="Experiência profissional" class="style8" 
                            src="../figuras/gExperienciaProfissional.gif" /></td>
                </tr>

                <tr>
                    <td>
                <asp:GridView runat="server" AllowPaging="True" 
                AutoGenerateColumns="False" CellPadding="4" 
                EnableModelValidation="True" GridLines="None" DataSourceID="dsInscritosExperiencias" 
                ForeColor="#333333" Width="100%" ID="gridExperiencias" 
                                                DataKeyNames="cpf,codexperiencia" 
                    CssClass="tabela" onrowcommand="gridExperiencias_RowCommand">
<AlternatingRowStyle BackColor="White" ForeColor="#284775"></AlternatingRowStyle>
                                                <Columns>
                                                    <asp:BoundField DataField="Experiencia" HeaderText="Experiência" >
                                                    <ControlStyle CssClass="tabela" />
                                                    <HeaderStyle HorizontalAlign="Left" />
                                                    <ItemStyle HorizontalAlign="Left" />
                                                    </asp:BoundField>
                                                    <asp:TemplateField ShowHeader="False">
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="False" 
                                                                CommandName="Delete" 
                                                                onclientclick="return confirm('Deseja excluir a experiência do inscrito?')" 
                                                                Text="Excluir"></asp:LinkButton>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>

<EditRowStyle BackColor="#999999"></EditRowStyle>

<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White"></FooterStyle>

<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White"></HeaderStyle>

<PagerStyle HorizontalAlign="Center" BackColor="#284775" ForeColor="White"></PagerStyle>

<RowStyle BackColor="#F7F6F3" ForeColor="#333333"></RowStyle>

<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333"></SelectedRowStyle>
</asp:GridView>

                                            <asp:SqlDataSource ID="dsInscritosExperiencias" 
                runat="server" ConnectionString="<%$ ConnectionStrings:conexao_intranet %>" 
                ProviderName="<%$ ConnectionStrings:conexao_intranet.ProviderName %>" 
                SelectCommand="SELECT * FROM CamaraInscritosExperiencias WHERE (CPF = @cpf)"
                DeleteCommand="DELETE FROM CamaraInscritosExperiencias WHERE CodExperiencia=@codExperiencia AND CPF=@cpf">
                                                <SelectParameters>
                                                    <asp:ControlParameter ControlID="ddInscritos" Name="cpf" 
                                                        PropertyName="SelectedValue" />
                                                </SelectParameters>
                                                <DeleteParameters>
                                                    <asp:Parameter Name="CodExperiencia" Type="Int32" />
                                                    <asp:Parameter Name="CPF" Type="String" />
                                                </DeleteParameters>

            </asp:SqlDataSource>

                                            </td>
                </tr>
                </table>

    </div>
    </form>
</body>
</html>
